<?php
/**
 * Created by PhpStorm.
 * User: tianleilei
 * Date: 2017/7/3
 * Time: 15:51
 */

use Illuminate\Support\Facades\Redis;
Route::group(['prefix'=>'blog','middleware'=>'test'],function(){

	Route::get('/index','Home\\Index@index');
	Route::get('del/{id}','Home\\Index@del')->name('blogDel');
	Route::get('add','User\\IndexController@test');
	Route::get('redis','Home\\Index@redis');

	Route::get('publish',function(){
		Redis::publish('test-channel', json_encode(['foo' => 'bar']));
	});

	Route::get('sub',function(){
		Redis::subscribe('test-channel', function ($message) {
			echo $message;
		});
	});
});